package be.sc.classicnetwork.service.impl;

import org.acegisecurity.userdetails.UserDetails;
import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.springframework.dao.DataAccessException;
import org.springframework.transaction.annotation.Transactional;

import be.sc.classicnetwork.dao.GenericDao;
import be.sc.classicnetwork.dao.UserDao;
import be.sc.classicnetwork.model.User;
import be.sc.classicnetwork.service.UserService;

/**
 * User Service Implementation.
 * 
 */
@Transactional
public class UserServiceImpl extends GenericServiceImpl<User> implements
		UserService {

	/**
	 * @param dao
	 */
	public UserServiceImpl(GenericDao<User> dao) {
		super(dao);
	}

	/**
	 * @see org.acegisecurity.userdetails.UserDetailsService#loadUserByUsername(java.lang.String)
	 */
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException, DataAccessException {
		return ((UserDao) getDao()).loadByUsername(username);
	}

}
